// Add a request interceptor
import axios from "axios";

// localStorage.setItem("satoken", jsonData.tokenInfo);

//配置axios拦截器，让所有请求携带token
axios.interceptors.request.use(
  (config) => {
    let authorization = localStorage.getItem("satoken");
    if (authorization) {
      config.headers["satoken"] = authorization;
    }
    return config;
  },
  (error) => {
    Promise.reject(error);
  }
);

export default axios;
